package com.cljz.makepassenger.widget;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

import com.cljz.makepassenger.R;


public class OkDialogView extends Dialog implements View.OnClickListener {

    private Context context;
    private YesDialogListener listener;

    private TextView title;
    private String tipText;
    private TextView tvYes;
    private TextView tvCancel;


    public OkDialogView(Context context) {
        super(context);
    }

    public OkDialogView(Context context, String tip, int theme, YesDialogListener listener) {
        super(context, theme);
        // TODO Auto-generated constructor stub
        this.context = context;
        this.listener = listener;
        this.tipText = tip;
    }

    @Override
    public void onClick(View v) {
        listener.onClick(v);
    }

    public interface YesDialogListener {
        public void onClick(View v);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.dialog_change_view);
        getWindow().setBackgroundDrawableResource(R.color.transparent);
        initView();
    }

    private void initView() {
        title = (TextView) findViewById(R.id.tv_line_one);
        tvYes = (TextView) findViewById(R.id.tv_yes);
        tvCancel = (TextView) findViewById(R.id.tv_cancel);
        tvYes.setOnClickListener(this);
        tvCancel.setOnClickListener(this);
        title.setText(tipText);
    }

}
